<template>
  <div class="viewer">
    <div v-if="props.visible" class="viewer-img">
      <viewer :images="[pics]">
        <div>
          <div class="close" @click="$emit('close')">
            <span>X</span>
          </div>
          <img class="img" :src="pics" />
        </div>
      </viewer>
    </div>
  </div>
</template>
<script setup lang="ts" name="FilePreview">
export interface FilePreviewProps {
  visible: boolean;
  pics: string;
}

const props = withDefaults(defineProps<FilePreviewProps>(), {
  visible: false
});

let $emit = defineEmits(['close']);
</script>
<style lang="scss" scoped src="./index.scss"></style>
